package com.cgy.entity;

import java.time.Year;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.springframework.format.annotation.DateTimeFormat;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table(name="resStatistics")
public class ResStatistics {

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private Integer rid;
	private Integer rUserTimes;//使用次数
	@DateTimeFormat(pattern = "yyyy")
	private String year;
	@DateTimeFormat(pattern = "MM")
	private String month;
	@DateTimeFormat(pattern = "dd")
	private String day;
	@OneToOne(fetch=FetchType.EAGER)
	@JoinColumn(name="zid")
	private ZiYuan ziYuan;
}
